package com.eastfair.venueservice.controller;

import com.eastfair.annotation.annotation.log.SysLog;
import com.eastfair.auth.dto.UserAccountDto;
import com.eastfair.auth.vo.UserAccountVo;
import com.eastfair.core.base.R;
import com.eastfair.venueservice.dto.RegisterDTO;
import com.eastfair.venueservice.service.RegisterService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * 服务商用户注册
 * </p>
 *
 * @author lyw
 * @date 2022-07-20
 */
@Slf4j
@Validated
@RestController
@RequestMapping("/register")
@Api(value = "register", tags = "服务商用户注册")
public class RegisterController {
    @Autowired
    private RegisterService registerService;


    /**
     * 服务商注册
     *
     * @param registerDTO 用户新增实体
     * @return
     */
    @ApiOperation(value = "服务商注册", notes = "服务商注册")
    @SysLog("服务商注册")
    @PostMapping("/user")
    public R<UserAccountVo> registerComplementUser(@RequestBody RegisterDTO registerDTO) {

        return R.success(registerService.registerSubSystemUser(registerDTO));
    }


}
